<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>带参二维码</title>
    <script src="../js/vue.js"></script>
    <script src="../js/jquery-1.11.3.min.js"></script>
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/parmsErwm.css">
    <link rel="stylesheet" href="../js/layui/css/layui.css">
</head>
<body>
        <div id="app">
                <!-- 头部 -->
                <top-bar ref="topbar"></top-bar>
                <!-- 开始 -->
                <div class="displayCenter">
                    <!-- 左边导航 -->
                    <div class="leftBox"> <left-site></left-site></div>
                    <div class="pageContent fffBackground">
                        <section class="weizhi">
                            您当前所在的位置：站点设置>关注时回复
                        </section>
                        <section class="daicantitle">
                            公众号带参二维码
                        </section>

                        <section class="btnInput-group displayBetween">
                            <div><span class="createErwm" @click="createErwm">创建二维码</span></div>
                            <div>
                                <select>
                                    <option value="1">全部二维码</option>
                                    <option value="2">全部二维码2</option>
                                    <option value="3">全部二维码3</option>
                                </select>
                                <input placeholder="请输入二维码名称或场景ID检索"/>
                                <span class="searchBtn">搜索</span>
                            </div>

                        </section>

                        <section class="erwmList">
                                <table class="layui-hide" id="LAY_table_user" lay-filter="user"></table> 
                        </section>
                    </div>
                </div>
                <tip-dialog ref="tipDialog" :dialogdata='dialogdata' v-if="dialogShow" @close="closeDialog" :leftbtnhandler="leftBtnHandler" :rightbtnhandler="rightBtnHandler"></tip-dialog>
        </div>
</body>

<!-- 头部 -->
<script src="../common/top-bar.js"></script>
<!-- 左侧导航栏 -->
<script src="../common/left-site.js"></script>
<!-- 提示弹窗 -->
<script src="../common/dialog.js"></script>
<script src="../js/public.js"></script>
<script src="../js/layui/layui.js" charset="utf-8"></script>



<script type="text/html" id="barDemo">
    <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> -->
    <a class="cazuoBtn">编辑</a>
    <a class="cazuoBtn">下载</a>
    <a class="cazuoBtn">数据分析</a>
    <a class="cazuoBtn">删除</a>
</script>
<script type="text/html" id="erweimaImg">
    <img src="{{d.erweimaImg}}"style="width:34px;height:34px" />
</script>
<script>
layui.use('table', function(){
  var table = layui.table;
  
  //方法级渲染
  table.render({
    elem: '#LAY_table_user'
    ,url: './ceshi.json'
    ,cols: [[
       //{checkbox: true, fixed: true},
       {field:'id', title: 'ID', width:0, sort: true, fixed: true,hide:true}
      ,{field:'erweimaName', title: '二维码名称', width:180}
      ,{field:'erweimaImg', title: '二维码', width:67,templet: '#erweimaImg'}
      ,{field:'smCount', title: '扫描次数', width:80}
      ,{field:'guanzhuCount', title: '关注总次数', width:80}
      ,{field:'peoples', title: '关注总人数',width:80}
      ,{field:'typs', title: '类型', width:100}
      ,{field:'createTime', title: '创建时间', sort: true, width:110}
      ,{field:'endTime', title: '到期时间', width:110}
      ,{title: '操作', align:'center',width:220,toolbar: '#barDemo'}
    ]]
    ,id: 'testReload'
    ,page: {
        layout: ['count','limit',  'prev', 'page', 'next', 'skip'], //自定义分页布局
        prev:'上一页',
        next:'下一页'
    }
    ,height: 540
    ,skin: 'nob'
    ,//even:true
  });
  
//   var $ = layui.$, active = {
//     reload: function(){
//       //var demoReload = $('#demoReload');
      
//       //执行重载
//       table.reload('testReload', {
//         page: {
//           curr: 1 //重新从第 1 页开始
//         }
//         ,where: {
//           key: {
//             id: demoReload.val()
//           }
//         }
//       }, 'data');
//     }
//   };
  
//   $('.demoTable .layui-btn').on('click', function(){
//     var type = $(this).data('type');
//     active[type] ? active[type].call(this) : '';
//   });
});

</script>
<script>
    new Vue({
        el:'#app',
        data:{
            dialogdata: null,
            dialogShow:false,
        },
        created:function(){
        },
        methods:{
            createErwm:function(){
                this.dialogdata={
                content:'创建二维码数量已达套餐上线，请升级套餐!',
                btnLeft:'取消',
                btnRight:'马上升级'
              }
              this.dialogShow = true;
            },
            closeDialog:function(v){//关闭弹框
            
              this.dialogShow = v;
            },
            leftBtnHandler:function(){//左边按钮的事件方法
                this.dialogShow = false;
                alert('左边按钮的触发事件')
            },
            rightBtnHandler:function() {//左边按钮的事件方法
                alert('右边边按钮的触发事件')
            }
        }
    })


</script>
</html>